#!/usr/bin/env python
# -*- coding: utf-8 -*-

#
# This program is free software; you can redistribute it and/or modify  
# it under the terms of the GNU General Public License as published by  
# the Free Software Foundation; either version 2 of the License, or     
# (at your option) any later version.                                   
#                                                                         
# A copy of the license can be found in the license.txt file supplied   
# with this software or at: http://www.gnu.org/copyleft/gpl.html       
#


class   Task(object) :
    def __init__(self, op=0, body=None, id=None) :
        self.id = id
        self.op = op
        self.body = body
        ## __init__()

    ####-----------------------------------------------------------####

    def __str__(self) :
        result = []
        if self.id :
            result.append('Task ID=%s' % repr(self.id))
        else :
            result.append('Task')
        result.append('OP=%s(%d)' % (NAME[self.op],self.op))

        return ' '.join(result)
        ## __str__()

    ## class Task


TASK_UNKNOWN       = 0

TASK_CREATE_TABLET = 50001
TASK_DROP_TABLET   = 50002


#######################################################################

NAME = {
    TASK_UNKNOWN       : 'Unknown',

    TASK_CREATE_TABLET : 'CreateTablet',
    TASK_DROP_TABLET   : 'DropTablet',

}


